find_path(GTEST_INCLUDE_DIR gtest)
find_library(GTEST_LIBRARY gtest)

if (GTEST_INCLUDE_DIR AND GTEST_LIBRARY)
    set(GTEST_FOUND ON)
endif (GTEST_INCLUDE_DIR AND GTEST_LIBRARY)

if (GTEST_FOUND)
    if (NOT GTEST_FIND_QUIETLY)
        message(STATUS "Found gtest include directory: ${GTEST_INCLUDE_DIR}")
        message(STATUS "Found gtest library: ${GTEST_LIBRARY}")
    endif(NOT GTEST_FIND_QUIETLY)
else (GTEST_FOUND)
    if (GTEST_FIND_REQUIRED)
        message(FATAL_ERROR "Could not find gtest include directory or library")
    endif (GTEST_FIND_REQUIRED)
endif (GTEST_FOUND)